package bams;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/17
 */
public class Account {
     private long id;
     private String password;
     private String name;
     private String personld;//身份证号码
     private String email;
     private double balance;
     public Account() {
     }
     public Account(long id, String password, String name,
                    String personld, String email, double balance) {
         this.id = id;
         this.password = password;
         this.name = name;
         this.personld = personld;
         this.email = email;
         this.balance = balance;
     }

    public long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPersonld() {
        return personld;
    }

    public void setPersonld(String personld) {
        this.personld = personld;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public double getBalance() {
        return balance;
    }
    public void setBalance(double balance) {
        this.balance = balance;
    }
    Account deposit(double amount) {
         this.balance += amount;
         return this;
    }
    Account withdraw(double amount) {
         if (amount > this.balance) {
             System.out.println("您的余额不足！"+"还可以取："+this.balance);
         }
         else{
             this.balance -= amount;
             return this;
         }
         return this;
    }
}


